/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package homebudget;

import java.util.LinkedList;

/**
 *
 * @author Krit
 */
public class Categories {
    public LinkedList<String> expenseCategories = new LinkedList<String>();
    public LinkedList<String> contributionCategories = new LinkedList<String>();

    //TODO: tutaj potem polaczenie z baza danych?
    public Categories(){
        addcontributionCategories();
        addexpenseCategories();
    }
    public void addexpenseCategories(){
        DataBaseMySql baza = new DataBaseMySql(HomeBudgetApp.getConnectionString());
        expenseCategories = baza.listaKategoriaWydatek();
        baza.close();
    }
    public void addcontributionCategories(){
        DataBaseMySql baza = new DataBaseMySql(HomeBudgetApp.getConnectionString());
        contributionCategories = baza.listaKategoriaPrzychod();
        baza.close();
    }

}
